package ca.usask.cs.decisiontree;

import ca.usask.cs.decisiontree.api.TreeNode;

/**
 * A DecisionTree represents a decision tree in its entirety. 
 * A DecisionTree contains TreeNodes connected by Edges, and has a root node to start from.
 * 
 * @invariant root node is not null
 * 
 * @author SaskTrav
 */
public interface DecisionTree {

    public String getTreeName();

    /**
     * Assigns the tree with a new name
     * @param theTreeName in string
     */
    public void setTreeName(String theTreeName);

    /**
     * retrieves the tree id
     * @return tree id in integer
     */
    public int getTreeID();

    /**
     * Checks if the DecisionTree is a valid Decision Tree
     *  @return True if Valid
     *          False if inValid
     */
    public boolean isValidTree();

    /**
     * Ensures that all the Terminal TreeNodes in the tree are calculated and
     * then looks
     * through each path and calculates the critical path
     * @return True on success
     *         False on failure
     *
     * @question if there is more than one critical Path then?
     *
     * @postcondition if the tree is not valid, the tree cannot have a valid
     * Critical path thus return false
     * @postcondition if the tree is valid, the tree must have a Critical path
     * thus return true
     */
    public boolean rollBack();


    /**
     * Retrieve the root node of the tree.
     *
     * @return A TreeNode corresponding to the root of the DecisionTree
     * @see TreeNode
     */
    public TreeNode getRootNode();

    
    // generate a regular structured decision-chance decision tree based 
    // on a high-level statement of its structure
/*    
    void GenerateStructuredDecisionChanceTree(boolean isDecisionNodeAtRoot, 
    										  String decisionNodeVensimVariable, Set<VensimDecisionInfo> decisionsForDecisionAllNodes, double timestepAfterDecisionNode,
    										  String chanceNodeVensimVariable, Set<VensimChanceInfo> eventsForAllChanceNodes, double timestepAfterChanceNode,
    										  String terminalNodeVensimVariable,
    										  double timeBegin,
    										  int countDepthBelowThisLevel);
    
 */  
}
